<?php
/**
 * main
 * @package    
 * @author     ben
 */
class heartBeatAction extends sfAction
{
    public function execute($request)
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            sfConfig::set('sf_web_debug', false);
        }

        $reqParams     = $this->getRequest()->getParameterHolder()->getAll();
        $resultSet     = JsCommonData::getCommonDatum();

        if(sfContext::getInstance()->getUser()->isAuthenticated())
        {
            $resultSet['info'] = JsCommonData::getSuccessDatum();
        }
        else
        {
            $resultSet['info'] = JsCommonData::getErrorDatum(
                       Doctrine::getTable(WacTable::$sysmsg)->getContentByCode("sys_invalid_user_authenticate"),  WacErrorCode::$logicError
                    );
        }

        return OutputHelper::getInstance()->outputJsonOrTextFormat($resultSet, $this);
    }
}